<template>
  <div class="line" ref="line"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  mounted() {
    // 指定图表的配置项和数据
    var myChart = echarts.init(this.$refs.line);
    let option = {
      xAxis: {
        type: "category",
        show:false,
        boundaryGap:false,
        // data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
          show:false,
        // type: "value",
      },
      grid: {
        left: 0,
        right: 0,
      },
      series: [
        {
          data: [150, 230, 224, 218, 135, 147, 260],
          type: "line",
          smooth: true,
          symbol: "none",
          areaStyle:{
              color:'#f00'
          }
        },
      ],
    };
    myChart.setOption(option);
    window.addEventListener("resize", () => {
      //图标自适应
      myChart.resize();
    });
  },
};
</script>

<style lang="scss" scoped>
.line{
    width: 100%;
    height: 100%;
}
</style>